class Func{
    private int num1;
    private int num2;

    public void setNum1(int num1){
        this.num1 = num1;
    }
    public int getNum1(){
        return num1;
    }

    public int getNum2() {
        return num2;
    }

    public void setNum2(int num2) {
        this.num2 = num2;
    }
}

public class TestDemo1 {
    public static void swap(Func fun1,Func fun2){
        int tmp = fun1.getNum1();
        fun1.setNum1(fun2.getNum2());
        fun2.setNum2(tmp);
    }
    public static void main(String[] args) {
       Func func1 = new Func();
       func1.setNum1(10);
       Func func2 = new Func();
       func2.setNum2(20);
       swap(func1, func2);
       System.out.println(func1.getNum1());
       System.out.println(func2.getNum2());

    }
}
